package com.thoughtservice.jspdoc.customize;


import com.thoughtservice.jspdoc.JSPPage;


//import com.alexmuc.cc.database.CCDB;

/**
 * Customizer for the JSP Documentation Generator for the YourDecor.ca specific
 * documentation.
 * 
 * @author alex
 */
public class YourDecorCustomizer
implements Customizer {

	public YourDecorCustomizer() {
	}

	public String customizeParam(JSPPage page, String name, String type, String source, String desc) {/*
		
		String pageName = page.getNamePath();
		pageName = pageName.replace('\\', '/');

		ResultSet rs = null;
		try {		
			rs = CCDB.executeQuery("SELECT * FROM ValidityParams WHERE pageName = '" + pageName + "' AND paramName = '" + name + "'");
			String sum = "";
			boolean first = true;
			while (rs.next()) {
				String test = rs.getString("test");
				String s = rs.getString("source");
				String d = rs.getString("errorDescription");
				int req = rs.getInt("required");
				
				if (first) {
					sum += "<table BORDER=\"1\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
					first = false;
				}
//				String concat = test + "|" + s + "|" + d + "|" + req;
//				System.out.println(concat);
				sum += " <tr>\n";

				sum += "  <td width=\"20%\"><font size=\"-1\">" + test   + "</font></td>\n";
				sum += "  <td width=\"10%\"><font size=\"-1\">" + s   + "</font></td>\n";
				String reqS = "Required";
				if (req == 1) 
					reqS = "Optional";
				sum += "  <td width=\"10%\"><font size=\"-1\">" + reqS + "</font></td>\n";
				sum += "  <td width=\"60%\"><font size=\"-1\">" + d + "</font></td>\n";
				
				sum += " </tr>\n";
			}
			if (! first) {
				sum += "</table>\n";
			}
			return sum;
		} catch (Exception e) {
			System.out.println(e);
			return "Error processing customizer";
		} finally {
			CCDB.close(rs);
		}
	*/
		return null;
	}
	
	public boolean customizeParams() {
		return true;
	}
	
}
